#include <vtkForceDirectedLayoutStrategy.h>
#include <vtkGraphLayoutView.h>
#include <vtkMutableUndirectedGraph.h>
#include <vtkNamedColors.h>
#include <vtkNew.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>

#include <vtkArcSource.h>
#include <vtkPolyDataMapper.h>
#include "vtkPolygon.h"
#include "vtkProperty.h"

#include "vtkLookupTable.h"
#include "vtkMinimalStandardRandomSequence.h"
#include "vtkCellData.h"
#include "vtkFloatArray.h"

#include "vtkGlyph3DMapper.h"
#include "vtkSphereSource.h"

#include "vtkInteractorStyleTrackballCamera.h"
#include "vtkPolyDataMapper2D.h"
#include "vtkMapper2D.h"
#include "vtkActor2D.h"
#include "vtkCamera.h"
#include "vtkProperty2D.h"
#include "vtkProp3D.h"
#include "vtkExtractVOI.h"
#include "vtkPlaneSource.h"
#include "vtkPlane.h"
#include "vtkSampleFunction.h"
#include "vtkContourFilter.h"
#include "vtkAppendFilter.h"
#include "vtkDataSetMapper.h"
#include "vtkClipPolyData.h"
#include "vtkImplicitBoolean.h"
#include "vtkImplicitFunction.h"
#include "vtkDiskSource.h"
#include "vtkExtractPolyDataGeometry.h"
#include "vtkImplicitSum.h"
#include "vtkClipClosedSurface.h"
#include "vtkPlaneCollection.h"
#include "vtkCellPicker.h"
#include "vtkInteractorStyleTrackballCamera.h"
#include "vtkColorTransferFunction.h"
#include "vtkCutter.h"

#include <vtkImageReader2Factory.h>
#include <vtkImageReader2.h>
#include <vtkImageActor.h>
#include <vtkImageMapper3D.h>
#include <vtkImageProperty.h>
#include <vtkLight.h>
#include <vtkLightCollection.h>

#include "vector"
#include "array"

#include "iostream"
#include "vtkIndent.h"

#include <vtkRenderPassCollection.h>
#include <vtkSequencePass.h>
#include <vtkValuePass.h>
#include <vtkOpaquePass.h>
#include <vtkOverlayPass.h>
#include <vtkCameraPass.h>
#include <vtkTranslucentPass.h>
#include <vtkRenderStepsPass.h>

namespace {


    vtkSmartPointer<vtkLookupTable> GetDivergingLut()
    {

//    vtkNew<vtkColorTransferFunction> ctf;
//    ctf->SetColorSpaceToDiverging();
////    ctf->AddRGBPoint(0.0, 0.230, 0.299, 0.754);
////    ctf->AddRGBPoint(0.5, 0.865, 0.865, 0.865);
////    ctf->AddRGBPoint(1.0, 0.706, 0.016, 0.150);
//
//    ctf->AddRGBPoint(0, 92, 201, 250);
//    ctf->AddRGBPoint(1.0, 117, 20, 114);


        vtkNew<vtkColorTransferFunction> colorTransferFunction;
        colorTransferFunction->SetColorSpaceToRGB();
        std::vector<std::array<double, 3>> colorList;
        colorList.push_back({92, 201, 250});
        colorList.push_back({42, 100, 246});
        colorList.push_back({17, 50, 196});
        colorList.push_back({117, 251, 122});
        colorList.push_back({102, 201, 113});
        colorList.push_back({67, 151, 42});
        colorList.push_back({254, 255, 127});
        colorList.push_back({247, 206, 85});
        colorList.push_back({241, 158, 56});
        colorList.push_back({236, 112, 107});
        colorList.push_back({234, 72, 63});
        colorList.push_back({186, 38, 26});
        colorList.push_back({234, 51, 247});
        colorList.push_back({188, 39, 198});
        colorList.push_back({117, 20, 124});

        double rangeMin = 0;
        double rangeMax = 16;
        int colorCount = colorList.size();
        double rangeSection = (rangeMax - rangeMin) / colorCount;
        for (int i = 0; i < colorCount; ++i) {
            std::array<double, 3> color = colorList[i];
            colorTransferFunction->AddRGBPoint(rangeSection * i, color[0] / 255.0, color[1] / 255.0, color[2] / 255.0);
            if (i < colorCount - 1) {
                std::array<double, 3> color1 = colorList[i + 1];
                colorTransferFunction->AddRGBPoint(rangeSection * (i + 1) - 0.01, color1[0] / 255.0, color1[1] / 255.0, color1[2] / 255.0);
            }
        }

        colorTransferFunction->Build();

        auto tableSize = 15;
        vtkNew<vtkLookupTable> lut;
        lut->SetVectorModeToRGBColors();
        lut->SetNumberOfTableValues(tableSize);
        lut->SetTableRange(0, 16);

        lut->UseBelowRangeColorOn();
        lut->SetBelowRangeColor(1.0, 1.0, 1.0, 0.0);

        lut->Build();

        for (auto i = 0; i < lut->GetNumberOfColors(); ++i)
        {
            std::array<double, 3> rgb;
            colorTransferFunction->GetColor(static_cast<double>(i) / lut->GetNumberOfColors(),
                                            rgb.data());
            colorTransferFunction->GetColor(static_cast<double>(i), rgb.data());

            std::array<double, 4> rgba{0.0, 0.0, 0.0, 1.0};
            std::copy(std::begin(rgb), std::end(rgb), std::begin(rgba));
            lut->SetTableValue(static_cast<vtkIdType>(i), rgba.data());
        }

        return lut;
    }


// Catch mouse events
    class MouseInteractorStyle : public vtkInteractorStyleTrackballCamera
    {
    public:
        static MouseInteractorStyle* New();
        vtkSmartPointer<vtkPolyData> pd2;
        vtkSmartPointer<vtkPolyData> pd1;

        MouseInteractorStyle()
        {
            pd1 = nullptr;
            pd2 = nullptr;
        }

        ~MouseInteractorStyle()
        {
            pd1 = nullptr;
            pd2 = nullptr;
        }


        virtual void OnLeftButtonDown() override {
//            vtkNew<vtkNamedColors> colors;

            // Get the location of the click (in window coordinates)
            int *pos = this->GetInteractor()->GetEventPosition();

            vtkNew<vtkCellPicker> picker;
            picker->SetTolerance(0.0005);

            // Pick from this location.
            picker->Pick(pos[0], pos[1], 0, this->GetDefaultRenderer());

            double *worldPosition = picker->GetPickPosition();
            std::cout << "Cell id is: " << picker->GetCellId() << std::endl;
            std::cout << "Cell GetCellIJK is: " << picker->GetCellIJK() << std::endl;
            std::cout << "Cell GetSubId is: " << picker->GetSubId() << std::endl;
            std::cout << "Cell GetPointId is: " << picker->GetPointId() << std::endl;
            std::cout << "Cell GetSelectionPoint is: " << picker->GetSelectionPoint()[0] << std::endl;

            if (this->pd2 && picker->GetCellId() >= 0) {
                vtkSmartPointer<vtkCell> cell = this->pd2->GetCell(picker->GetCellId());
                double *bounds1 = cell->GetBounds();
                std::cout << "Cell GetBounds is: " << cell->GetBounds()[0] << "-" << cell->GetBounds()[1]  << "-" << cell->GetBounds()[2] << "-" << cell->GetBounds()[3] << "-" << cell->GetBounds()[4] << std::endl;

                int resultIndex = -1;

                double bounds[6];
                for (int i = 0; i < pd1->GetNumberOfCells(); ++i) {
                     this->pd1->GetCellBounds(i, bounds);
                    std::cout << "Bounds: " << bounds[0] << "-" << bounds[1]  << "-" << bounds[2] << "-" << bounds[3] << "-" << bounds[4] << std::endl;
                    if (bounds1[0] == bounds[0] && bounds1[1] == bounds[1] && bounds1[2] == bounds[2] && bounds1[3] == bounds[3]){
                        resultIndex = i;
                        break;
                    }
                }
//                cell1->Delete();


                std::cout << "resultIndex : " << resultIndex << std::endl;
            }

        }
    };

    vtkStandardNewMacro(MouseInteractorStyle);

} // namespace

int main(int, char*[]) {

    vtkNew<vtkRenderer> renderer;
    vtkNew<vtkRenderWindow> renderWindow;
    renderWindow->SetWindowName("RegularPolygonSource");
    renderWindow->AddRenderer(renderer);
    vtkNew<vtkRenderWindowInteractor> renderWindowInteractor;
//    renderWindowInteractor->SetInteractorStyle(vtkNew<vtkInteractorStyleTrackballCamera>)
    renderWindowInteractor->SetRenderWindow(renderWindow);


    vtkNew<vtkNamedColors> colors;


    const int RowCount = 10;
    const int ColCount = 10;
    const double RowDegree = vtkMath::Pi() * 2 / RowCount;
    const double Radius = 500;
    const int AreaAvgRadius = Radius / ColCount;
    const int ArcSegmentCount = 1;
    double ArcSegmentDegree = RowDegree / ArcSegmentCount;

    vtkNew<vtkCellArray> allPolygons;
    vtkNew<vtkPoints> allPoints;
    vtkNew<vtkPolyData> polygonPolyData;
    vtkNew<vtkFloatArray> cellData;

    for (int i = 0; i < RowCount; ++i) {

        double degree = RowDegree * i;
        degree = degree + vtkMath::Pi() * 0.5; // 旋转90度

        for (int j = 0; j < ColCount; ++j) {

            vtkNew<vtkPolygon> polygon;
            polygon->GetPointIds()->SetNumberOfIds((ArcSegmentCount + 1) * 2);
            vtkIdType numberOfPoints = allPoints->GetNumberOfPoints();

            double radius0 = j * AreaAvgRadius;
            double radius1 = (j + 1) * AreaAvgRadius;

            for (int k = 0; k < ArcSegmentCount + 1; ++k) {
                double d0 = degree + (ArcSegmentDegree) * k;
                double x0 = -cos(d0) * radius0; // 添加-号改变x周方向
                double y0 = sin(d0) * radius0;

//                if (x0 > 200) {
//                    x0 = 200;
//                }
//                if (y0 > 200) {
//                    y0 = 200;
//                }


                allPoints->InsertNextPoint(x0, y0, 0.0);

                double d1 = degree + (ArcSegmentDegree) * k;
                double x1 = -cos(d1) * radius1; // 添加-号改变x周方向
                double y1 = sin(d1) * radius1;
                allPoints->InsertNextPoint(x1, y1, 0.0);

                polygon->GetPointIds()->SetId(k, numberOfPoints + (ArcSegmentCount - k));
                polygon->GetPointIds()->SetId(k + ArcSegmentCount + 1, numberOfPoints + ArcSegmentCount + 1 + k);
            }

            allPolygons->InsertNextCell(polygon);

            cellData->InsertNextValue(j - 2 + i);


        }
    }

    polygonPolyData->SetPoints(allPoints);
    polygonPolyData->SetPolys(allPolygons);
    polygonPolyData->GetCellData()->SetScalars(cellData);


//    vtkNew<vtkPolyDataMapper> mapper;
//    mapper->SetInputData(polygonPolyData);
//
//    mapper->SetScalarRange(0, 16);
//    mapper->ScalarVisibilityOn();
//    mapper->SetLookupTable(GetDivergingLut());
//    mapper->Update();
//
//    vtkNew<vtkActor> actor;
//    actor->SetMapper(mapper);
//    actor->GetProperty()->EdgeVisibilityOn();
//    actor->GetProperty();
//    renderer->AddActor(actor);




//    // Create cutter
//    vtkNew<vtkCutter> cutter;
//    cutter->SetCutFunction(plane);
//    cutter->SetInputData(aBeamActor->GetMapper()->GetInput());
//    cutter->Update();
//    vtkNew<vtkPolyDataMapper> cutterMapper;
//    cutterMapper->SetInputConnection(cutter->GetOutputPort());




//    auto center = polygonPolyData->GetCenter();
//    vtkNew<vtkPlane> plane1;
//    plane1->SetOrigin(center[0], -200, center[2]);
//    plane1->SetNormal(0.0, -1.0, 0.0);
//    vtkNew<vtkPlane> plane2;
//    plane2->SetOrigin(center[0], center[1], center[2]);
//    plane2->SetNormal(0.0, 0.0, 1.0);
//    vtkNew<vtkPlane> plane3;
//    plane3->SetOrigin(-200, center[1], center[2]);
//    plane3->SetNormal(-1.0, 0.0, 0.0);



//    vtkNew<vtkPlaneSource> planeSource;
//    planeSource->SetXResolution(10);
//    planeSource->SetYResolution(10);
//    planeSource->SetCenter(0, 0, -1);
//    planeSource->SetOrigin(-500, 500, -1);
//    planeSource->SetPoint1(500, 500, -1);
//    planeSource->SetPoint2(-500, -500, -1);
//
//    vtkNew<vtkPlane> plane;
//    plane->SetOrigin(-200, 0, 0);
//    plane->SetNormal(1, 0, 0);
//
//    vtkNew<vtkPlane> plane1;
//    plane1->SetOrigin(200, 0, 0);
//    plane1->SetNormal(-1, 0, 0);
//
//    vtkNew<vtkPlane> plane3;
//    plane3->SetOrigin(0, 200, 0);
//    plane3->SetNormal(0, -1, 0);
//
//    vtkNew<vtkPlane> plane4;
//    plane4->SetOrigin(0, -200, 0);
//    plane4->SetNormal(0, 1, 0);
//
//    vtkNew<vtkPlaneCollection> planes;
//    planes->AddItem(plane);
//    planes->AddItem(plane1);
//    planes->AddItem(plane3);
//    planes->AddItem(plane4);
//
//    vtkNew<vtkClipClosedSurface> clipper;
//    clipper->SetInputData(polygonPolyData);
//    clipper->SetClippingPlanes(planes);
////    clipper->SetPassPointData(true);
////    clipper->PassPointDataOn();
//    clipper->SetScalarModeToColors();
////    clipper->SetGenerateOutline(true);
////    clipper->SetTolerance(10.0);
////    clipper->SetGenerateFaces(true);
////    clipper->SetActivePlaneId(2);
////    clipper->SetScalarModeToColors();
////    clipper->SetClipColor(colors->GetColor3d("Banana").GetData());
////    clipper->SetBaseColor(colors->GetColor3d("Tomato").GetData());
////    clipper->SetActivePlaneColor(colors->GetColor3d("SandyBrown").GetData());
//
////    vtkNew<vtkDataSetMapper> clipMapper;
////    clipMapper->SetInputConnection(clipper->GetOutputPort());
////    clipMapper->SetInputData(polygonPolyData);
//
//    vtkNew<vtkPolyDataMapper> clipMapper;
//    clipMapper->SetInputConnection(clipper->GetOutputPort());
//
//    clipMapper->SetScalarRange(0, 16);
//    clipMapper->ScalarVisibilityOn();
//    clipMapper->SetLookupTable(GetDivergingLut());
//    clipMapper->Update();
//
//    vtkNew<vtkActor> clipActor;
//    clipActor->SetMapper(clipMapper);
////    clipActor->GetProperty()->SetColor(1.0000, 0.3882, 0.2784);
////    clipActor->GetProperty()->SetInterpolationToFlat();
//    clipActor->GetProperty()->EdgeVisibilityOn();
//    renderer->AddActor(clipActor);





// 裁剪了
//    vtkNew<vtkPlaneSource> planeSource;
//    planeSource->SetXResolution(10);
//    planeSource->SetYResolution(10);
//    planeSource->SetCenter(0, 0, -1);
//    planeSource->SetOrigin(-500, 500, -1);
//    planeSource->SetPoint1(500, 500, -1);
//    planeSource->SetPoint2(-500, -500, -1);
//
//    vtkNew<vtkPlane> plane;
//    plane->SetOrigin(-200, 0, 0);
//    plane->SetNormal(1, 0, 0);
//
//    vtkNew<vtkPlane> plane1;
//    plane1->SetOrigin(200, 0, 0);
//    plane1->SetNormal(-1, 0, 0);
//
//    vtkNew<vtkPlane> plane3;
//    plane3->SetOrigin(0, 200, 0);
//    plane3->SetNormal(0, -1, 0);
//
//    vtkNew<vtkPlane> plane4;
//    plane4->SetOrigin(0, -200, 0);
//    plane4->SetNormal(0, 1, 0);
//
//    vtkNew<vtkImplicitBoolean> func;
//    func->SetOperationTypeToUnion();
//    func->AddFunction(plane);
//    func->AddFunction(plane1);
//    func->AddFunction(plane3);
//    func->AddFunction(plane4);
//
////    vtkNew<vtkImplicitSum> func;
//
//    vtkNew<vtkExtractPolyDataGeometry> extractPolyDataGeometry;
//    extractPolyDataGeometry->SetInputData(polygonPolyData);
//    extractPolyDataGeometry->SetImplicitFunction(func);
//    extractPolyDataGeometry->Update();
//
//    vtkNew<vtkPolyDataMapper> mapper;
//    mapper->SetInputData(extractPolyDataGeometry->GetOutput());
//    mapper->ScalarVisibilityOff();
//
//    vtkNew<vtkActor> actor;
//    actor->SetMapper(mapper);
//    actor->GetProperty()->EdgeVisibilityOn();
//    actor->GetProperty()->SetColor(1, 0, 0);
//    renderer->AddActor(actor);


// 无效
//    planeSource->GetOutputPort()

//    vtkSmartPointer<vtkExtractVOI> extractVOI;
//    extractVOI->SetInputConnection(plane->GetOutputPort());
//    extractVOI->SetVOI(-400, 400, -500, 500, 0, 0);

//    vtkNew<vtkPolyDataMapper> mapper2;
//    mapper2->SetInputConnection(extractVOI->GetOutputPort());
//
//    vtkNew<vtkActor> voiActor;
//    renderer->AddActor(voiActor);



    // 裁剪圆环OK，但是边缘cell被裁剪变形了!!!! ---

    vtkNew<vtkPlaneSource> planeSource;
    planeSource->SetXResolution(10);
    planeSource->SetYResolution(10);
    planeSource->SetCenter(0, 0, -1);
    planeSource->SetOrigin(-500, 500, -1);
    planeSource->SetPoint1(500, 500, -1);
    planeSource->SetPoint2(-500, -500, -1);

    vtkNew<vtkPlane> plane;
    plane->SetOrigin(-200, 0, 0);
    plane->SetNormal(1, 0, 0);

    vtkNew<vtkPlane> plane1;
    plane1->SetOrigin(200, 0, 0);
    plane1->SetNormal(-1, 0, 0);

    vtkNew<vtkPlane> plane3;
    plane3->SetOrigin(0, 200, 0);
    plane3->SetNormal(0, -1, 0);

    vtkNew<vtkPlane> plane4;
    plane4->SetOrigin(0, -200, 0);
    plane4->SetNormal(0, 1, 0);

    vtkNew<vtkImplicitBoolean> func;
    func->SetOperationTypeToUnion();
    func->AddFunction(plane);
    func->AddFunction(plane1);
    func->AddFunction(plane3);
    func->AddFunction(plane4);

    vtkNew<vtkClipPolyData> clipper;
    clipper->SetClipFunction(func);
        clipper->SetInputData(polygonPolyData);
//    clipper->SetInputConnection(sphereSource->GetOutputPort());
//    clipper->GenerateClipScalarsOn();
//    clipper->GenerateClippedOutputOn();
//    clipper->SetValue(50);
//    clipper->InsideOutOn();
//    clipper->SetOutputPointsPrecision(0.5);

    clipper->Update();



    vtkNew<vtkPolyDataMapper> mapper;
//    mapper->SetInputConnection(clipper->GetOutputPort());
//    mapper->SetInputData(clipper->GetOutput());

//     ！！！意外收获，直接可以裁剪，并且不会改变cell结构
    mapper->SetInputData(polygonPolyData);
    vtkNew<vtkPlaneCollection> planes;
    planes->AddItem(plane);
    planes->AddItem(plane1);
    planes->AddItem(plane3);
    planes->AddItem(plane4);
    mapper->SetClippingPlanes(planes);


    mapper->SetScalarRange(0, 16);
    mapper->ScalarVisibilityOn();
    mapper->SetLookupTable(GetDivergingLut());
    mapper->SetScalarModeToUseCellData();
    mapper->Update();


    vtkNew<vtkActor> actor;
    actor->SetMapper(mapper);
    actor->GetProperty()->EdgeVisibilityOn();
    actor->GetProperty()->SetRoughness(1);
    actor->GetProperty()->SetAmbient(1);
    actor->GetProperty()->SetAmbientColor(0, 1,  0);
    renderer->AddActor(actor);


    auto pd = clipper->GetPolyDataInput(0);
    int c1 = polygonPolyData->GetNumberOfCells();
    int count = pd->GetNumberOfCells();

    vtkSmartPointer<vtkPolyData> pd2 = mapper->GetInput();
    int c2 = pd2->GetNumberOfCells();

//    vtkIdList *id;
//    pd->GetPolys()->GetCellAtId(0, id);
//    vtkIdList *id2;
//    pd2->GetPolys()->GetCellAtId(0, id2);


//    GetPoints

    vtkSmartPointer<vtkCell> cell1 = pd->GetCell(0);
    vtkSmartPointer<vtkCell> cell22 = pd2->GetCell(0);

    vtkSmartPointer<vtkPoints> p1 = cell1->GetPoints();
    vtkSmartPointer<vtkPoints> p2 = cell22->GetPoints();


//    // 只能裁剪,隐函数创建的数据源。。。
//    vtkNew<vtkPlane> plane;
//    plane->SetOrigin(0, 0, 0);
//    plane->SetNormal(1, 1, 1);
//
//    vtkNew<vtkSampleFunction> sample;
//    sample->SetSampleDimensions(20, 20, 20);
//    sample->SetImplicitFunction(plane);
//    double value = 10.0;
//    double xmin = -value, xmax = value, ymin = -value, ymax = value,
//            zmin = -value, zmax = value;
//    sample->SetModelBounds(xmin, xmax, ymin, ymax, zmin, zmax);
//
//    int dims[3];
//    sample->GetSampleDimensions(dims);
//
//    vtkNew<vtkExtractVOI> extract;
//    extract->SetInputConnection(sample->GetOutputPort());
////    extract->SetVOI(8, dims[0] - 8, 5, dims[1] - 9, 0, 0);
//    extract->SetVOI(0, dims[0], 0, dims[1], 0, 0);
//
//
////    // Map planes
//    vtkNew<vtkDataSetMapper> planesMapper;
//    planesMapper->SetInputConnection(extract->GetOutputPort());
//    planesMapper->SetScalarRange(0, 7);
////
//    vtkNew<vtkActor> extractActor;
//    extractActor->SetMapper(planesMapper);
//    extractActor->GetProperty()->SetAmbient(1.);
//    extractActor->GetProperty()->EdgeVisibilityOn();
//    renderer->AddActor(extractActor);


    // Set the custom stype to use for interaction.
//    vtkNew<MouseInteractorStyle> style;
//    style->SetDefaultRenderer(renderer);
//    renderWindowInteractor->SetInteractorStyle(style);
//    style->pd1 = pd;
//    style->pd2 = pd2;


    // 测试底部添加图片后的透明效果

    char *inputFilename = "/Users/dai/Work/vtk/VTK-Example/AMy/ImageMap/map3.png";

    vtkNew<vtkImageReader2Factory> readerFactory;
    vtkSmartPointer<vtkImageReader2> imageReader;
    imageReader.TakeReference(readerFactory->CreateImageReader2(inputFilename));
    imageReader->SetFileName(inputFilename);

    vtkNew<vtkImageActor> actor3;
    actor3->GetMapper()->SetInputConnection(imageReader->GetOutputPort());
    actor3->Update();
    double *imageBounds = actor3->GetBounds();
    std::cout << imageBounds[0] << "-" << imageBounds[1] << "-" << imageBounds[2] << "-" << imageBounds[3];
    double minW = 800 * 2;
    double imageW = imageBounds[1] - imageBounds[0];
    double imageH = imageBounds[3] - imageBounds[2];
    double scale = minW / imageW;
    double x = -imageW * scale * 0.5;
    double y = -imageH * scale * 0.5;
    actor3->SetPosition(x, y, -200);
    actor3->SetScale(scale);
    actor3->GetProperty()->BackingOn();
    actor3->GetProperty()->SetBackingColor(1, 0, 0);
    actor3->GetProperty()->SetColorLevel(0);
    renderer->AddActor(actor3);


    // 解决颜色表中有透明度时，actor全部透明渲染的问题
    renderer->SetUseDepthPeeling(1);
//    renderer->SetOcclusionRatio(0.2);
    renderWindow->SetMultiSamples(0);
    renderWindow->AlphaBitPlanesOn();



    renderWindow->Render();


//    std::cout << "Print===actor:";
//    actor->PrintSelf(std::cout, dent);
    renderWindowInteractor->Start();



    return EXIT_SUCCESS;
}